package com.gpzx.zx.module.home.ui.fragment

import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.databinding.ViewDataBinding
import com.gpzx.zx.R
import com.gpzx.zx.databinding.FragmentXnbBinding
import com.gpzx.zx.module.home.frame.presenter.XnbPrestener
import com.gpzx.zx.module.home.frame.view.XnbView
import com.wkq.base.frame.fragment.MvpBindingFragment
import com.wu.common.utils.net.UsTvShowDataCallBack
import com.wu.common.utils.site.XNBSite
import com.wu.common.utils.site.XnbInfo

/**
 * 作 者 : wkq
 *
 * 时 间 : 2021/1/7 13:25
 *
 * 名 字 : XnbFragment
 *
 * 简 介 :
 *
 */
class XnbFragment :MvpBindingFragment<XnbView, XnbPrestener,FragmentXnbBinding>(){

    companion object {
        fun newInstance(): XnbFragment {
            var bandle: Bundle = Bundle()
            var xnbF: XnbFragment = XnbFragment()
            xnbF.arguments = bandle
            return xnbF

        }
    }
    override fun getLayoutId(): Int {
       return R.layout.fragment_xnb
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        mvpView.initView()
        XNBSite.getXNB(object : UsTvShowDataCallBack<List<XnbInfo>> {
            override fun onFail(message: String?) {
                Log.e("","")
            }

            override fun onSuccess(infos: List<XnbInfo>?) {
             mvpView.setData(infos)
            }

            override fun onLoading() {
                Log.e("","")
            }
        })
    }

}